package org.xteam.sled.model;

import java.util.HashSet;
import java.util.Set;

import org.xteam.sled.semantic.exp.Exp;
import org.xteam.sled.semantic.exp.VariableSubstitute;

public class LatentDisjunct extends BaseDisjunct<LatentSequence> {

	public LatentDisjunct(String name, Set<Exp> conditions, LatentSequence seq) {
		super(name, conditions, seq);
	}

	public LatentDisjunct(LatentSequence seq) {
		super(null, new HashSet<Exp>(), seq);
	}

	@Override
	public boolean hasConditions() {
		throw new RuntimeException();
	}

	@Override
	public IDisjunct postDots() {
		throw new RuntimeException();
	}

	@Override
	public IDisjunct preDots() {
		throw new RuntimeException();
	}

	@Override
	public IDisjunct seq(IDisjunct other) {
		return super.seq(other);
	}

	public LabelledDisjunct injectLatent() {
		return new LabelledDisjunct(name, new HashSet<Exp>(conditions), sequence.injectLatent());
	}

	@Override
	protected BaseDisjunct<LatentSequence> createDisjunct(String name, Set<Exp> conds,
			ISequence seq) {
		return new LatentDisjunct(name, conds, (LatentSequence)seq);
	}

	@Override
	public IDisjunct nameUnnamed(String newName) {
		if (name != null)
			return this;
		return new LatentDisjunct(newName, new HashSet<Exp>(conditions), sequence);
	}

}
